﻿<local:DocumentBase x:Class="WPFExcelReport.YCAFS02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:dat="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core" 
                    xmlns:wep="clr-namespace:WPFExcelReport" 
                    Loaded="Window_Loaded" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:tra="clr-namespace:WPFExcelReport.TranslationByMarkupExtension;assembly=ReflectionStudio.Core"
                    FontSize="12" 
                    Background="White" 
                    Title="款号信息总览" 
                    HorizontalAlignment="Stretch"
                    Margin="0,0,0,0" 
                    VerticalAlignment="Stretch"
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:MaskPrice  x:Key="dprice"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetQP" />
        <CollectionViewSource   x:Key="vwFS02" Source="{Binding Path=ICC_FS02,Source={StaticResource SetData}}" />        
    </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
            <RowDefinition Height="*" MinHeight="300"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Expander  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
            Name="expLog" ExpandDirection="Down" IsExpanded="True">
            <StackPanel>               
                    <WrapPanel Width="1023" Height="30">
                        <Label Content="类别编号："    Width="71" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="14" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtARTTYPE" Width="39" Margin="10,0,0,0"  HorizontalAlignment="Left" Panel.ZIndex="0" Text="FC"
                         KeyUp="txtART_KeyUp"  CharacterCasing="Upper" Background="Pink" MaxLength="3" FontSize="14" Foreground="#FF141111" Height="26" />
                        <Label Content="款号："    Width="45" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="14" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtARTICLE" Width="170" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="1"
                         Focusable="True" KeyUp="txtART_KeyUp" Background="YellowGreen" MaxLength="20" FontSize="14" Foreground="#FF141111" Height="26" />
                        <Label Content="年份："    Width="43" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="14" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtCOLL" Width="71" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="2"
                         KeyUp="txtART_KeyUp" Background="Pink" MaxLength="4" FontSize="14" Foreground="#FF141111" Height="26" />
                        <Label Content="波段："    Width="52" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="14" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtREASON" Width="71" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="3"
                         KeyUp="txtART_KeyUp" Background="Pink" MaxLength="3" FontSize="14" Foreground="#FF141111" Height="28" />

                    </WrapPanel>
                    <WrapPanel Width="1023" Height="29">
                        <Label Content="大类："    Width="45" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="14" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtPRDGRP" Width="71" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="4"
                         KeyUp="txtART_KeyUp" Background="Pink" MaxLength="3" FontSize="14" Foreground="#FF141111" Height="26" />
                        <Label Content="小类："    Width="47" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="14" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtARTGRP" Width="71" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="5"
                         KeyUp="txtART_KeyUp" Background="Pink" MaxLength="4" FontSize="14" Foreground="#FF141111" Height="26" />
                        <Label Content="材质："    Width="44" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="14" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtMATERIAL" Width="71" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="6"
                         KeyUp="txtART_KeyUp" Background="Pink" MaxLength="3" FontSize="14" Foreground="#FF141111" Height="26" />
                        <Label Content="采购员："    Width="65" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="14" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtPURCHASER" Width="148" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="7"
                         KeyUp="txtART_KeyUp" Background="Pink" MaxLength="8" FontSize="14" Foreground="#FF141111" Height="26" />
                        <Label Content="尺码组："    Width="61" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="14" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtSIZE" Width="71" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="8"
                         KeyUp="txtART_KeyUp" Background="Pink" MaxLength="3" FontSize="14" Foreground="#FF141111" Height="26" />
                    </WrapPanel>
                <WrapPanel >
                    <Label Content="国家标准："    Width="83" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="14" VerticalAlignment="Center" Foreground="#FF141111" />
                    <TextBox Name="txtSTANDARD" Width="171" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink" Panel.ZIndex="9"
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="18" FontSize="14" Foreground="#FF141111" Height="26" />
                    <Label Content="安全类别："    Width="84" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="14" VerticalAlignment="Center" Foreground="#FF141111" />
                    <TextBox Name="txtSAFTY" Width="111" Margin="5,0,0,0"  HorizontalAlignment="Left" Background="Pink" Panel.ZIndex="10"
                         KeyUp="txtART_KeyUp" CharacterCasing="Upper" MaxLength="9" FontSize="14" Foreground="#FF141111" Height="27" />
                    <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnQuery" Click="btnQuery_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" TabIndex="13">
                        <Button.Background>
                            <ImageBrush ImageSource="Images/Search.png" />
                        </Button.Background>
                    </Button>
                    <Button Content="EXCEL" Margin="20,0,0,0" Name="btnReport" Width="47" Click="btnReport_Click" TabIndex="14" />
                    <!--Button   Content="预览" Margin="20,0,0,0" Name="btnPrintPreview" Width="51" Click="btnPrintPreview_Click" TabIndex="15" /-->
                </WrapPanel>
            </StackPanel>
        </Expander> 
        <FlowDocumentScrollViewer Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"  >
                <FlowDocument> 
                    <Paragraph>
                    <DataGrid  AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwFS02}}"  
                              HeadersVisibility="Column"
                              x:Name="MasterDg"    
                              Height="Auto" FontSize="12" FontFamily ="Times New Roman"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" >
                        <!-- , Converter={StaticResource ResourceKey=gb2312}-->
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=STYLE}" Header="款号" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=STYLENAME}" Header="款号描述" Width="SizeToCells" MinWidth="70" />
                            <DataGridTextColumn Binding="{Binding Path=COLORNAME}" Header="颜色" Width="SizeToCells" MinWidth="60" />
                            <DataGridTextColumn Binding="{Binding Path=SIZENAME}" Header="尺码" Width="SizeToCells" MinWidth="60" />
                            <DataGridTextColumn Binding="{Binding Path=SALESPRICE}" Header="销售价" Width="SizeToCells" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=COSTPRICE}" Header="成本价" Width="SizeToCells" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=TYPE}" Header="类型" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=TYPENAME}" Header="类型名称" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=COLL}" Header="年份" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=REASON}" Header="季节" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=REASONNAME}" Header="季节名称" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=PRDGROUP}" Header="大类" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=PRDGRPNAME}" Header="大类名称" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=ARTGROUP}" Header="小类" Width="SizeToCells" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=ARTGRPNAME}" Header="小类名称" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=MATERIAL}" Header="材质" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=MATERIALNAME}" Header="材质名称" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=COUNTRYSTANDARD}" Header="国家标准" Width="SizeToCells" MinWidth="80" />
                            <DataGridTextColumn Binding="{Binding Path=SAFTYNAME}" Header="安全类型" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=CONTDATE}" Header="合同日期" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=MARKDATE}" Header="上市日期" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=PURCHASER}" Header="采购员" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=FSGRRAS}" Header="尺码组" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=TKZ}" Header="供应类型" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=SUPPNAME}" Header="供应商" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=SUPPART}" Header="供应商品种名" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=SUPPCOLOR}" Header="供应商颜色" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=SUPPPRICE}" Header="供应商单价" Width="SizeToCells" MinWidth="30" />
                        </DataGrid.Columns>
                    </DataGrid > 
                    </Paragraph>
                </FlowDocument>
            </FlowDocumentScrollViewer>     
    </Grid>
</local:DocumentBase>